package com.ymatou.iapi.livebuyer.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.livebuyer.parameter.ChangeStreamStatusBean;
import com.ymatou.iapi.livebuyer.service.ChangeStreamStatusCall;
import com.ymatou.iapi.liveseller.parameter.CreateSellerLiveBean;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.LiveRoomCallService;
import com.ymttest.database.model.LiveRoom;
/**
*修改腾讯云直播推流状态
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_ChangeStreamStatus{
	private static ChangeStreamStatusBean changestreamstatusBean;
	private static ChangeStreamStatusCall changestreamstatusCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("修改腾讯云直播推流状态");
	}

	@Before
	public void caseUp() {
		changestreamstatusBean=new ChangeStreamStatusBean();
		changestreamstatusCall=new ChangeStreamStatusCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(changestreamstatusCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_ChangeStreamStatus_001() {
		Logger.start(true,"修改腾讯云直播推流状态禁用成功");
		try {
			LiveRoom createsellerliveBean = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(null));
			changestreamstatusBean.setLiveId(createsellerliveBean.getId());
			changestreamstatusBean.setChangeStatus(0);
			changestreamstatusCall.setData(changestreamstatusBean);
			changestreamstatusCall.callService();			
			Logger.verifyEquals("200", changestreamstatusCall.getString("code"), "验证code");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_ChangeStreamStatus_002() {
		Logger.start(true,"修改腾讯云直播推流状态允许成功");
		try {
			LiveRoom createsellerliveBean = LiveRoomCallService.CreateSellerLive(LiveRoomCallService.initCreatesellerliveBean(null));
			changestreamstatusBean.setLiveId(createsellerliveBean.getId());
			changestreamstatusBean.setChangeStatus(1);
			changestreamstatusCall.setData(changestreamstatusBean);
			changestreamstatusCall.callService();			
			Logger.verifyEquals("200", changestreamstatusCall.getString("code"), "验证code");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}